<template>
  <ConfigProvider
    :get-popup-container="getPopupContainer"
    component-size="small"
    :locale="zhCN"
  >
    <transition name="fade" mode="out-in">
      <keep-alive >
        <suspense>
          <template #default>
            <RouterView />
          </template>
        </suspense>
      </keep-alive>
    </transition>
    <div id="popup-container" ref="popupContainerRef"></div>
  </ConfigProvider>
</template>
<script lang="ts" setup>
import bootstrap from "@/core/bootstrap";
import { ref,computed } from "vue";
import zhCNObj from "ant-design-vue/es/locale/zh_CN";
import dayjs from "dayjs";
import "dayjs/locale/zh-cn";
import store from "@/store";
bootstrap();

const popupContainerRef = ref<HTMLElement>(null);
const getPopupContainer = ref((triggerNode?: HTMLElement): HTMLElement => {
  if (triggerNode) {
    return (
      (triggerNode?.parentNode as HTMLElement) ||
      popupContainerRef.value ||
      document.body
    );
  }
  return popupContainerRef.value || document.body;
});
const zhCN = ref(zhCNObj);
const tabs = computed(() => store.getters.tabs.map(tab => "page" + tab.key))
console.log(tabs,"页签")
dayjs.locale("zh-cn");
</script>
<script lang="ts">
import { ConfigProvider } from "ant-design-vue";
export default {
  name: "App",
  components: {
    ConfigProvider,
  },
};
</script>
